main(n,i,a,b,c,d,x,y)
{
	for(gets(&n);~scanf("%d",&n);printf("%d/%d\n",x,y))
	{
		for(x=0,y=1;n--;)
		{
			scanf("%d%d",&a,&b);
			x=x*b+y*a;
			y*=b;

			c=x<y?x:y;
			d=x>y?x:y;
			while(c)
			{
				a=d%c;
				d=c;
				c=a;
			}
			x/=d;
			y/=d;
		}
	}
}
